// components/navigationBar/index.js
const app = getApp()
Component({

  options: {
    addGlobalClass: true,
    styleIsolation: "apply-shared",
    multipleSlots: true
  },

  /**
   * 组件的属性列表
   */
  properties: {
    bgColor: {
      type: String,
      value: '#FFF'
    },
    styles: {
      type: String,
      value: ''
    },
    title: {
      type: String,
      value: ""
    },
    useHomeBtn: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    navBarHeight: app.globalData.navBarHeight,
    menuTop: app.globalData.menuTop,
    menuHeight: app.globalData.menuHeight,
    pageLen: 0
  },

  lifetimes: {
    attached() {
      console.log(getCurrentPages());
      this.setData({
        pageLen: getCurrentPages().length
      })
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleBack() {
      wx.navigateBack({
        delta: 1
      })
    }
  }
})